using System;

namespace UniversalAdminSystem.Domian.Core.ValueObjects;

/// <summary>
/// 用户信息ID值对象
/// </summary>
public class UserInfoId
{
    public Guid Value { get; private set; }

    private UserInfoId(Guid value)
    {
        Value = value;
    }

    public static UserInfoId Create(Guid value)
    {
        return new UserInfoId(value);
    }

    public static implicit operator Guid(UserInfoId userInfoId)
    {
        return userInfoId.Value;
    }

    public static implicit operator UserInfoId(Guid value)
    {
        return new UserInfoId(value);
    }

    public override bool Equals(object? obj)
    {
        if (obj is UserInfoId other)
        {
            return Value.Equals(other.Value);
        }
        return false;
    }

    public override int GetHashCode()
    {
        return Value.GetHashCode();
    }

    public override string ToString()
    {
        return Value.ToString();
    }
} 